﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class RSS_GetRss : System.Web.UI.Page
{
    Article_BU art_BUS = new Article_BU();
    
    protected void Page_Load(object sender, EventArgs e)
    {
        string cate_id = Request.QueryString["Category_id"].ToString();
        DataTable dt = new DataTable();
        dt = art_BUS.Get_Article_By_Id_Category_BU(18);
        NewsRSS rss = new NewsRSS();
        NewsRSS.RssChannel channel = new NewsRSS.RssChannel();
        channel.Title = "ICMS FPT-APTECH";
        channel.Link = "";
        channel.Description = "Trang chu";
        rss.AddRssChannel(channel);
        foreach (DataRow dr in dt.Rows)
        {
            NewsRSS.RssItem item = new NewsRSS.RssItem();
            item.Title = dr["article_name"].ToString();
            item.Link = "http://article_id"+dr["article_id"].ToString();
            item.Description =dr["article_sumary"].ToString();
            rss.AddRssItem(item);
        }
        Response.Clear();

        Response.ContentType = "text/xml";

        Response.Write(rss.RssDocument);

        Response.End();
       
    }
}